package com.jsnkj.basic.bean

import android.content.ContentResolver
import android.net.Uri

/**
 * 媒体文件类
 * @param uri 路径
 */
open class MediaBean @JvmOverloads constructor(var uri: Uri) {
}

/**
 * 照片
 * @param uri 路径
 */
class PhotoBean(
    uri: Uri,
    date: String,
    val imageId: Long = -1,
    val contentResolver: ContentResolver? = null,
    val path: String = "",
    var selected: Boolean = false
) :
    MediaBean(uri) {

    override fun hashCode(): Int {
        return uri.hashCode()
    }

    override fun equals(other: Any?): Boolean {
        if (other is PhotoBean) {
            return uri.toString() == other.uri.toString()
        }
        return false
    }

    override fun toString(): String {
        return uri.toString()
    }
}

/**
 * 视频
 * @param uri 路径
 * @param duration 时长
 */
class VideoBean(uri: Uri, private val duration: Int) : MediaBean(uri) {
}